<template>
  <el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情' : '编辑'" :close-on-click-modal="false" :visible.sync="visible" class="cu-dialog cu-dialog_center" lock-scroll width="950px">
    <el-row :gutter="15" class="">
      <el-form ref="elForm" :model="dataForm" size="small" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules">
        <!--        <el-col :span="12">
          <el-form-item label="退款时间" prop="time">
            <el-date-picker v-model="dataForm.time" placeholder="请选择" clearable required :style="{ width: '100%' }" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款方式" prop="method">
            <el-radio-group v-model="dataForm.method" required :style="{width: '100%', display: 'flex', flexWrap: 'wrap'}">
              <el-radio :style="{width: '120px'}" v-for="(item, index) in methodOptions" :key="index" :label="item.id">{{ item.fullName }}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款金额" prop="amount">
            <el-input v-model="dataForm.amount" placeholder="请输入" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款类型" prop="type">
            <el-select v-model="dataForm.type" placeholder="请选择" clearable required >
              <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="退款原因" prop="reason">
            <el-input v-model="dataForm.reason" placeholder="请输入" required show-word-limit :style="{ width: '100%' }" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="开户行" prop="bankName">
            <el-input v-model="dataForm.bankName" placeholder="请输入" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="开户人" prop="accountHolder">
            <el-input v-model="dataForm.accountHolder" placeholder="请输入" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="银行帐号" prop="bankAccount">
            <el-input v-model="dataForm.bankAccount" placeholder="请输入" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="其他帐号" prop="otherAccount">
            <el-input v-model="dataForm.otherAccount" placeholder="请输入" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>-->
        <el-col :span="12">
          <el-form-item label="客户姓名" prop="name">
            <el-input v-model="dataForm.name" placeholder="请输入客户姓名" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="校区名称" prop="campusId">
            <el-select v-model="dataForm.campusId" placeholder="请选择校区" clearable filterable :loading="campusLoading" @focus="loadCampusOptions" :style="{ width: '100%' }">
              <el-option v-for="item in campusOptions" :key="item.id" :label="item.fullName + ' (' + item.enCode + ')'" :value="item.id" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="款项类型" prop="status">
            <el-select v-model="dataForm.status" placeholder="请选择" clearable required>
              <el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款品牌" prop="brand">
            <el-select v-model="dataForm.brand" placeholder="请选择签约品牌" filterable clearable required :style="{ width: '100%' }">
              <el-option :key="item.id" :label="item.fullName" :value="item.enCode" v-for="item in brandOptions" />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="收款金额" prop="rAmount">
            <el-input v-model="dataForm.rAmount" placeholder="请输入收款金额" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款时间" prop="time">
            <el-date-picker v-model="dataForm.time" placeholder="请选择" clearable required :style="{ width: '100%' }" type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp"></el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款类型" prop="type">
            <el-select v-model="dataForm.type" placeholder="请选择" clearable required>
              <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="退款金额" prop="amount">
            <el-input v-model="dataForm.amount" placeholder="请输入退款金额" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="对接人" prop="managerId">
            <el-input v-model="dataForm.managerId" placeholder="请输入对接人" clearable required :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="退款原因" prop="reason">
            <el-input v-model="dataForm.reason" placeholder="请输入退款原因" required show-word-limit :style="{ width: '100%' }" type="textarea" :autosize="{ minRows: 4, maxRows: 4 }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="退款方式" prop="method">
            <!--            <el-select v-model="dataForm.method" placeholder="请选择收款方式" clearable required :style="{ width: '100%' }">
              <el-option v-for="(item, index) in methodOptions" :key="index" :label="item.fullName" :value="item.id"></el-option>
            </el-select>-->
            <el-radio-group v-model="dataForm.method">
              <el-radio :style="{ width: '120px' }" v-for="(item, index) in methodOptions" :key="index" :label="item.id">{{ item.fullName }}</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取 消</el-button>
      <el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail">确 定</el-button>
    </span>
  </el-dialog>
</template>
<style scoped>
.el-time-spinner__wrapper {
  width: 100% !important;
}
@import url(index.scss);
</style>
<script>
export { default } from '../Form/index.js'
</script>
